package com.atguigu.gulimall.cart.vo;

import lombok.Data;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.util.List;

/**
 * @Author : Jungle
 * @Description : 购物项内容
 */
@Accessors(chain = true)
@Data
public class CartItem {
    private Long skuId;
    /**
     * 是否选中,默认选中
     */
    private Boolean check = true;
    private String title;
    private String image;
    /**
     * 套餐信息
     */
    private List<String> skuAttr;
    private BigDecimal price;
    /**
     * 数量
     */
    private Integer count;
    /**
     * 总价
     */
    private BigDecimal totalPrice;
    /**
     * 计算购物项总价
     */
    public BigDecimal getTotalPrice() {
        BigDecimal multiply = this.price.multiply(new BigDecimal("" + this.count));
        return multiply;
    }

}
